package com.example.littlepainter

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.navigation.fragment.findNavController
import com.example.littlepainter.databinding.FragmentDrawBinding


class DrawFragment : Fragment() {
    //lateinit修饰符，用于声明一个延迟初始化的非空类型变量(延迟加载）
    private lateinit var binding:FragmentDrawBinding

    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        binding = FragmentDrawBinding.inflate(inflater,container,false)
        return binding.root
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        binding.textView.setOnClickListener {
            findNavController().navigate(DrawFragmentDirections.actionDrawFragmentToHomeFragment())
        }
    }


}